<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>添加权限组</title>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/Global.css"  />  
<style type="text/css">
#formtable{ margin:20px 20px 0px 20px; border:dashed #03F 1px; font-size:14px; float:left;}
#buttondiv{ margin:20px 0px 0px 0px;}
</style> 
<script language="javascript" type="text/javascript">
function search(formobj)
{
	formobj.submit();
}

function checkAll()
{
	
}
function operateAction(uri, value, formobj)
{
	var actionname = value.replace(/\s+/g,"");
	//修改
	if (actionname == "修改")
	{
		var items = document.getElementsByName("item");
		if (items.length != 1) 
		{
			alert("一次只能修改一条记录，请重新选择！");
			return false;
		}		
	}		
	else
	{
		formobj.action = "<%=request.getContextPath()%>"+uri;
		formobj.submit();
	}
}
</script>
</head>
<body>
<div class="pagetitlediv" align="center">
权限组列表
</div>
<div class="pagebody">
<form name="searchform" action="<%=request.getContextPath()%>/security/permissiongroup_listAction.action" method="post">
<table>
  <tr>
    <td>权限组名称：</td><td><input name="searchname" type="text" size="30" /></td><td><input type="button" class="inputbutton" value="查 询" onclick="search(this.form)" /></td>
  </tr>
</table>
</form>
<form name="permgroupform" action="" method="post">
<table border="1"> 
  <tr>
    <td><input type="checkbox" onclick="selectAll()" /></td>
    <td>序号</td>
    <td>权限组名称</td>
    <td>权限组创建人</td>
    <td>权限组创建时间</td>
    <td>是否允许分配子权限</td>
    <td>权限组简介</td>
  </tr>
  <s:iterator id="permgroup" value="#request.permgroup" status="st" >
  <tr>
    <td><input name="item" type="checkbox" value="<s:property value="#permgroup.permgroupid"/>"/></td>
    <td><s:property value="#st.getIndex()"/></td>
    <td><s:property value="#permgroup.permgroupname"/></td>
    <td><s:property value="#permgroup.createpersonname"/></td>
    <td><s:property value="#permgroup.permgroupregdate"/></td>
    <td><s:property value="#permgroup.enableallot"/></td>
    <td><s:property value="#permgroup.permgroupintro"/></td>
  </tr>
  </s:iterator>
  <tr>
    <td colspan="7" align="center">
      <s:iterator id="perm" value="#request.subperms" >
        <input id="<s:property value="#perm.permid"/>" type="button" value="<s:property value="#perm.permName"/>" onClick="operateAction(this.id, this.value, this.form)" />&nbsp;&nbsp;
      </s:iterator>
      
      <a href="/security/permissiongroup_addAction.action">添加</a>
    </td>
  </tr>
</table>
</form>
</div>
</body>
</html>
